import allure
import requests

from config.config import cmp_server, cmp_port


@allure.step("Call login api, username {username}, password {password}, domain {domain}")
def login_api(username, password, domain):
    resp = requests.post(url=f"http://{cmp_server}:{cmp_port}/compass-fdm-studio-service/authentication/login",
                         json={"username": username, "password": password, "domain": domain})
    return resp
